package com.zh.harmony.startup;

import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;

/**
 * Logger打印
 */
@SuppressWarnings("WeakerAccess")
public final class StartupLogger {
    private StartupLogger() {
        // Does nothing.
    }

    /**
     * The log tag.
     */
    private static final String TAG = "StartupLogger";

    /**
     * To enable logging set this to true.
     */
    static final boolean DEBUG = false;

    /**
     * Info level logging.
     *
     * @param message The message being logged
     */
    public static void i(String message) {
        HiLog.info(new HiLogLabel(HiLog.LOG_APP, 0x00201, TAG), message);
    }

    /**
     * Error level logging
     *
     * @param message   The message being logged
     * @param throwable The optional {@link Throwable} exception
     */
    public static void e(String message, Throwable throwable) {
        throwable.printStackTrace();
        HiLog.error(new HiLogLabel(HiLog.LOG_APP, 0x00201, TAG), message);
    }
}